package monitor

import (
	"fmt"
	"time"
)

var (
	timerInterval *time.Ticker
)

func init() {
	timerInterval = nil
}

//启动定时监测任务
func TimingMonitorStart() {
	go func() { //启动一个协程
		timerInterval = time.NewTicker(time.Second * time.Duration(60))
		defer timerInterval.Stop()
		for {
			select {
			case <-timerInterval.C:
				TimingMonitorTask()
			}
		}
	}()
}

//停止定时检测任务
func TimingMonitorStop() {
	if timerInterval != nil {
		timerInterval.Stop()
	}
}

//定时监测任务
func TimingMonitorTask() {
	fmt.Println("DCE400启动监控扫描 @ ", time.Now().Format("2006-01-02 15:04:05"))

	//检测超时工单

}
